Skip to content

Support transactionReceipts subscription in eth_subscribe#17828

Merged
canepat merged 10 commits intoerigontech:mainfrom
rlaisqls:feat/transaction-receipts-subscription
Dec 16, 2025
Merged

Support transactionReceipts subscription in eth_subscribe#17828
canepat merged 10 commits intoerigontech:mainfrom
rlaisqls:feat/transaction-receipts-subscription

Conversation

@rlaisqls
Copy link
Contributor

@rlaisqls rlaisqls commented Nov 9, 2025

This PR implements real-time transaction receipt subscriptions via WebSocket (eth_subscribe("transactionReceipt")), inspired by ethereum/go-ethereum#32697.
Clients can now receive receipts immediately as blocks are processed, without polling.

resolve #17596

Implementation

  • Added new subscribe type transactionReceipts

  • (Core -> RPC module) Extended gRPC protocol with structured receipt data

    • Instead of RLP-encoded bytes, receipts are sent as structured protobuf messages
  • Replaced RecentLogs with RecentReceipts structure that handles both receipts and logs:

    • Receipts contain logs, so we extract logs from receipts for existing log subscriptions
    • Single source of truth for both receipt and log data
    • Maintains backward compatibility with existing log subscriptions
  • Implemented filtering at both core (execution node) and RPC daemon levels, similar to existing log subscription architecture

Filter Example

Both levels support:

No filter (subscribe to all receipts):

{
  "jsonrpc":"2.0",
  "id":1,
  "method":"eth_subscribe",
  "params":[
    "transactionReceipts",  {}
  ]
}
or
{
  "jsonrpc":"2.0",
  "id":1,
  "method":"eth_subscribe",
  "params":[
    "transactionReceipts",  {"transactionHashes": []}
  ]
}

Transaction hash filter:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_subscribe",
  "params": [
    "transactionReceipts", {"transactionHashes": ["0x123...","0x456..."]}
  ]
}

Response Example

{
  "jsonrpc": "2.0",
  "method": "eth_subscription",
  "params": {
    "subscription": "0x5465f633defb53ab2b63275bef29b6f7",
    "result": {
      "blockHash": "0xe1699970061c7bb45e54bf6235ebf66c467f7292ece610955fd818075fc20360",
      "blockNumber": "0x11cffe7",
      "contractAddress": null,
      "cumulativeGasUsed": "0x1c65c",
      "effectiveGasPrice": "0x7",
      "from": "0x62669a879f5c90d9f8aec826882b2da6cc28b352",
      "gasUsed": "0x1c65c",
      "logs": [
        {
          "address": "0xf4ebcc2c077d3939434c7ab0572660c5a45e4df5",
          "data": "0x000000000000000000000000000000000000000000000000000000012a153440000000000000000000000000000000000000000000000000000000006910841b",
          "topics": [
            "0xdd84a3fa9ef9409f550d54d6affec7e9c480c878c6ab27b78912a03e1b371c6e",
            "0x000000000000000000000000000000000000000000000000370e65a434afcdd5"
          ]
        }
      ],
      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000020000200000000000000000000000000000000000000000800000000200201000000000100000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001800000000000000000000010000000200000008000008000004000000000000000000002000000000000040000000000000000000000000000000000000020000000000800000000000000000000000000000000000000000000000000000000",
      "status": "0x1",
      "to": "0x4d8193f845eb3540e0bda9451296600362e22b15",
      "transactionHash": "0x320e1f62b23fb374938c32c910fa1e6c00c3cace6ba39f052f860c3520a21380",
      "transactionIndex": "0x0",
      "type": "0x2"
    }
  }
}

Copy link
Member

@canepat canepat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

I've requested some changes, and you need to rebase + resolve conflicts

@rlaisqls rlaisqls force-pushed the feat/transaction-receipts-subscription branch 2 times, most recently from b5f9d2c to b6e6ee8 Compare December 4, 2025 00:21
@canepat
Copy link
Member

canepat commented Dec 10, 2025

@rlaisqls sorry for being late here, it's been an intense week.

LGTM, please one more rebase to resolve conflict on node/interfaces and I will run workflows.

rlaisqls and others added 8 commits December 12, 2025 18:10
Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
- Update ethutils import path to execution/types/ethutils
- Update shards import path to node/shards
- Fix accounts.Address type conversion using .Value()
@rlaisqls rlaisqls force-pushed the feat/transaction-receipts-subscription branch from b6e6ee8 to a07e1df Compare December 12, 2025 09:14
@rlaisqls
Copy link
Contributor Author

@canepat Thanks for the review! Rebased and conflicts resolved

@canepat canepat merged commit 8cf35ca into erigontech:main Dec 16, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support transactionReceipts subscription in eth_subscribe

3 participants